package cn.caplike.demo.repository.design.pattern.eventbus.guava;

import com.google.common.eventbus.Subscribe;

@SuppressWarnings({"unused", "UnstableApiUsage"})
public class EventListener {
    /** 监听 Integer 类型的消息 */
    @Subscribe
    public void listenInteger(Integer param) {
        System.out.println(Thread.currentThread().getId() + " - EventListener#listenInteger -> " + param);
    }

    /** 监听 String 类型的消息 */
    @Subscribe
    public void listenString(String param) {
        System.out.println(Thread.currentThread().getId() + " - EventListener#listenString -> " + param);
    }

    @Subscribe
    public void listenException(RuntimeException exception) {
        throw exception;
    }
}
